let routerHistoryOption = null;
let getRouterHistoryOption = (length) => {
    if (routerHistoryOption && !length) return routerHistoryOption;
    routerHistoryOption = {};
    routerHistoryOption.routerLength = window.history.length;
    return routerHistoryOption
};

console.log(getRouterHistoryOption());

let back = (that) => {
    if(navigator.userAgent.indexOf("Html5Plus") > -1) {
        that.$router.back();
    }else{
        if (window.history.length == getRouterHistoryOption().routerLength) {
            that.$router.replace('/');
        } else {

            that.$router.back();
        }
    }

};


export default {
    back: back,
    getRouterHistoryOption: getRouterHistoryOption,
}
